package com.xinsoft.controller.erp;

import com.xinsoft.common.Response;
import com.xinsoft.service.SyncBasicService;
import com.xinsoft.service.impl.SyncBasicAdapter;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 基础信息同步
 */
@RestController
@RequestMapping("/erp/basicData")
public class ErpBasicDataController {

    @Resource(name = "syncBasicAdapter")
    private SyncBasicAdapter syncBasicAdapter;


    /**
     * 物料同步
     */
    @GetMapping("/materielSync")
    public Response<?> materielSync() {
        return syncBasicAdapter.materielSync();
    }

    /**
     * 单位同步
     */
    @GetMapping("/unitSync")
    public Response<?> unitSync() {
        return syncBasicAdapter.unitSync();
    }

    /**
     * BOM同步
     */
    @GetMapping("/bomSync")
    public Response<?> bomSync() {
        return syncBasicAdapter.bomSync();
    }

    /**
     * 仓库、仓位同步
     * todo 需要将数据表SysWarehouseItem中的id主键限制去除
     */
    @GetMapping("/wareHouseSync")
    public Response<?> wareHouseSync() {
        return syncBasicAdapter.wareHouseSync();
    }

    /**
     * 用户同步
     */
    @GetMapping("/userSync")
    public Response<?> userSync() {
        return syncBasicAdapter.userSync();
    }

    /**
     * 客户同步
     */
    @GetMapping("/clientSync")
    public Response<?> clientSync() {
        return syncBasicAdapter.clientSync();
    }

    /**
     * 供应商同步
     */
    @GetMapping("/supplierSync")
    public Response<?> supplierSync() {
        return syncBasicAdapter.supplierSync();
    }

    /**
     * 部门同步
     */
    @GetMapping("/departSync")
    public Response<?> departSync() {
        return syncBasicAdapter.departSync();
    }

}
